<%@page import="com.fractalist.man.constants.ManConstants"%>
<%@page import="com.fractalist.base.core.constants.SystemConstants"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
	pageContext.setAttribute("baseweburl",
			SystemConstants.UPLOAD_WEB_URL);
	pageContext.setAttribute("articleTypeMap",
			ManConstants.ARTICLE_TYPE_MAP);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>系统参数配置</title>
<link rel="stylesheet" href="${ctx }/css/styles.css" type="text/css" />
<script type="text/javascript" src="${ctx }/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="${ctx }/js/jquery.form.js"></script>
<jsp:include page="/common/jscalendar.jsp"></jsp:include>
</head>
<body style="overflow-y: scroll;">
	<script>

		function saveConfig() {
			var site_url = $("#site_url").val();
			var site_name = $("#site_name").val();
			var site_beian = $("#site_beian").val();
			var site_close = $("#site_close").val();
			var site_email = $("#site_email").val();
			var site_stats = $("#site_stats").val();
			var site_title = $("#site_title").val();
			var site_keywords = $("#site_keywords").val();
			var site_close_msg = $("#site_close_msg").val();
			var site_description = $("#site_description").val();
			var attach_maxsize = $("#attach_maxsize").val();
			var attach_allowext = $("#attach_allowext").val();
			//var mail_auth = $("#mail_auth").val();
			var mail_from = $("#mail_from").val();
			var mail_port = $("#mail_port").val();
			var mail_type = $("#mail_type").val();
			var mail_user = $("#mail_user").val();
			var mail_server = $("#mail_server").val();
			var mail_password = $("#mail_password").val();
			var member_register = $("#member_register").val();
			var member_emailcheck = $("#member_emailcheck").val();
			var member_login_verify = $("#member_login_verify").val();
			var member_registecheck = $("#member_registecheck").val();
			var qq_client_id = $("#qq_client_id").val();
			var weibo_client_id = $("#weibo_client_id").val();
			var qq_client_secret = $("#qq_client_secret").val();
			var weibo_client_secret = $("#weibo_client_secret").val();
			var weibo_code = $("#weibo_code").val();
			$.post("${ctx}/isstSet/saveConfig.action", {
				site_url : site_url,
				site_name : site_name,
				site_beian : site_beian,
				site_close : site_close,
				site_email : site_email,
				site_stats : site_stats,
				site_title : site_title,
				site_keywords : site_keywords,
				site_close_msg : site_close_msg,
				site_description : site_description,
				attach_maxsize : attach_maxsize,
				attach_allowext : attach_allowext,
				//mail_auth : mail_auth,
				mail_from : mail_from,
				mail_port : mail_port,
				mail_type : mail_type,
				mail_user : mail_user,
				mail_server : mail_server,
				mail_password : mail_password,
				member_register : member_register,
				member_emailcheck : member_emailcheck,
				member_login_verify : member_login_verify,
				member_registecheck : member_registecheck,
				qq_client_id : qq_client_id,
				weibo_client_id : weibo_client_id,
				qq_client_secret : qq_client_secret,
				weibo_client_secret : weibo_client_secret,
				weibo_code : weibo_code
			}, function(data) {
				location.href = "${ctx}/isstSet/viewConfig.action";
			})
		}

	</script>
	<div id="wrapper">
		<div id="content_wrap">
			<div class="tabs_content">
				<div class="active_tab" id="tab1"></div>
				<div id="table_wrapper" style="width: 100%; overflow: auto;">
					<form>
						<table class="table" cellpadding="0" cellspacing="0">
							<tr>
								<td width="20%">网站网址</td>
								<td><input id="site_url" name="site_url" value="${site_url}"/></td>
							</tr>
							<tr>
								<td>网站名称</td>
								<td><input id="site_name" name="site_name" value="${site_name}"/></td>
							</tr>
							<tr>
								<td>备案号</td>
								<td><input id="site_beian" name="site_beian" value="${site_beian}"/></td>
							</tr>
							<tr>
								<td>关闭网站</td>
								<td>
									<select id="site_close" name="site_close" >
										<c:if test="${site_close=='on' }">
											<option value="on" selected="selected">ON</option>
											<option value="off">OFF</option>
										</c:if>
										<c:if test="${site_close!='on' }">
											<option value="on">ON</option>
											<option value="off" selected="selected">OFF</option>
										</c:if>
									</select>
								</td>
							</tr>
							<tr>
								<td>站点邮箱</td>
								<td><input id="site_email" name="site_email" value="${site_email}"/></td>
							</tr>
							<tr>
								<td>统计代码</td>
								<td><textarea rows="2" cols="80" id="site_stats" name="site_stats">${site_stats}</textarea></td>
							</tr>
							<tr>
								<td>网站标题</td>
								<td><input id="site_title" name="site_title" value="${site_title}"/></td>
							</tr>
							<tr>
								<td>关键词</td>
								<td><input id="site_keywords" name="site_keywords" value="${site_keywords}"/></td>
							</tr>
							<tr>
								<td>关闭说明</td>
								<td><textarea rows="2" cols="80" id="site_close_msg" name="site_close_msg">${site_close_msg}</textarea></td>
							</tr>
							<tr>
								<td>网站简介</td>
								<td><textarea rows="2" cols="80" id="site_description" name="site_description">${site_description}</textarea></td>
							</tr>
							<tr>
								<td>允许上传附件大小</td>
								<td><input id="attach_maxsize" name="attach_maxsize" value="${attach_maxsize}"/></td>
							</tr>
							<tr>
								<td>允许上传附件类型</td>
								<td><input id="attach_allowext" name="attach_allowext" value="${attach_allowext}"/></td>
							</tr>
							<tr>
								<td>邮件发送模式</td>
								<td>
									<select id="mail_type" name="mail_type" >
										<c:if test="${mail_type=='SMTP' }">
											<option value="SMTP" selected="selected">SMTP</option>
											<option value="sendMail">sendMail</option>
										</c:if>
										<c:if test="${mail_type!='SMTP' }">
											<option value="SMTP">SMTP</option>
											<option value="sendMail" selected="selected">sendMail</option>
										</c:if>
									</select>
								</td>
							</tr>
							<tr>
								<td>SMTP服务器</td>
								<td><input id="mail_server" name="mail_server" value="${mail_server}"/></td>
							</tr>
							<tr>
								<td>SMTP用户名</td>
								<td><input id="mail_user" name="mail_user" value="${mail_user}"/></td>
							</tr>
							<tr>
								<td>SMTP密码</td>
								<td><input type="password" id="mail_password" name="mail_password" value="${mail_password}"/></td>
							</tr>
							<tr>
								<td>SMTP端口</td>
								<td><input id="mail_port" name="mail_port" value="${mail_port}"/></td>
							</tr>
							<tr>
								<td>发件人邮箱</td>
								<td><input id="mail_from" name="mail_from" value="${mail_from}"/></td>
							</tr>
							<!-- 
							<tr>
								<td>AUTH LOGIN验证</td>
								<td>
									<select id="mail_auth" name="mail_auth" >
										<c:if test="${mail_auth==1 }">
											<option value="1" selected="selected">是</option>
											<option value="0">否</option>
										</c:if>
										<c:if test="${mail_auth!=1 }">
											<option value="1">是</option>
											<option value="0" selected="selected">否</option>
										</c:if>
									</select>
								</td>
							</tr>
							 -->
							<tr>
								<td>允许新会员注册</td>
								<td>
									<select id="member_register" name="member_register" >
										<c:if test="${member_register==1 }">
											<option value="1" selected="selected">是</option>
											<option value="0">否</option>
										</c:if>
										<c:if test="${member_register!=1 }">
											<option value="1">是</option>
											<option value="0" selected="selected">否</option>
										</c:if>
									</select>
								</td>
							</tr>
							<tr>
								<td>新会员注册需要邮件验证</td>
								<td>
									<select id="member_emailcheck" name="member_emailcheck" >
										<c:if test="${member_emailcheck==1 }">
											<option value="1" selected="selected">是</option>
											<option value="0">否</option>
										</c:if>
										<c:if test="${member_emailcheck!=1 }">
											<option value="1">是</option>
											<option value="0" selected="selected">否</option>
										</c:if>
									</select>
								</td>
							</tr>
							<tr>
								<td>注册登陆开启验证码</td>
								<td>
									<select id="member_login_verify" name="member_login_verify" >
										<c:if test="${member_login_verify==1 }">
											<option value="1" selected="selected">是</option>
											<option value="0">否</option>
										</c:if>
										<c:if test="${member_login_verify!=1 }">
											<option value="1">是</option>
											<option value="0" selected="selected">否</option>
										</c:if>
									</select>
								</td>
							</tr>
							<tr>
								<td>新会员注册需要审核</td>
								<td>
									<select id="member_registecheck" name="member_registecheck" >
										<c:if test="${member_registecheck==1 }">
											<option value="1" selected="selected">是</option>
											<option value="0">否</option>
										</c:if>
										<c:if test="${member_registecheck!=1 }">
											<option value="1">是</option>
											<option value="0" selected="selected">否</option>
										</c:if>
									</select>
								</td>
							</tr>
							<tr>
								<td>QQ接口 client id</td>
								<td><textarea rows="2" cols="80" id="qq_client_id" name="qq_client_id">${qq_client_id}</textarea></td>
							</tr>
							<tr>
								<td>QQ接口 client secret</td>
								<td><textarea rows="2" cols="80" id="qq_client_secret" name="qq_client_secret">${qq_client_secret}</textarea></td>
							</tr>
							<tr>
								<td>微博接口 client id</td>
								<td><textarea rows="2" cols="80" id="weibo_client_id" name="weibo_client_id">${weibo_client_id}</textarea></td>
							</tr>
							<tr>
								<td>微博接口 client secret</td>
								<td><textarea rows="2" cols="80" id="weibo_client_secret" name="weibo_client_secret">${weibo_client_secret}</textarea></td>
							</tr>
							<tr>
								<td>微博代码</td>
								<td><textarea rows="2" cols="80" id="weibo_code" name="weibo_code">${weibo_code}</textarea></td>
							</tr>
							<tr>
								<td></td>
								<td><input type="button" value="提交"
									onclick="saveConfig();" /></td>
							</tr>
						</table>
					</form>
				</div>
			</div>
		</div>
	</div>
	</div>
</body>
</html>

